package org.xdq.demo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.xdq.demo.dto.GoodsDto;
import org.xdq.demo.dto.PageParam;
import org.xdq.demo.model.Goods;

@Mapper
public interface GoodsMapper {
	
	public List<Goods> findGoodsList(PageParam pageParam);
	
	@Insert("insert into goods(g_name,g_price,g_desc,g_num) values(#{g_name},#{g_price},'无',1000)")
	public int saveNewGoods(GoodsDto dto);

	public void deleteGoods(@Param("gids") Integer... gids);

	@Update("update goods set g_name=#{g_name},g_price=#{g_price} where g_id=#{g_id}")
	public void updateGoods(GoodsDto dto);

}
